<extend name="Share/layout" />
<block name="body">

<form class="regBox JS_input" action="{:U('User/nickname')}">
    <div class="regHd_logo">
        <span><img src="__ASSETS__/share/images/LOGO.png"></span>
        <font>66Play</font>
    </div>
    <div class="wh reg_currentBt">
        <div class="regTtBox">
            <span>
                <font>进入页面</font>
                <font>注册账号</font>
                <font class="no">完成注册</font>
            </span>
        </div>
        <ul class="regList">
            <li title="请设置昵称，昵称确定后不可修改" class="regInputName">
                <span class="reglistSt inputName"></span>
                <input type="text" name="nickname" placeholder="请设置昵称，昵称确定后不可修改">
                <input type="hidden" name="redirect_url" value="{$Think.get.redirect_url}">
                <span class="regTs_text"></span>
            </li>
            
        </ul>
        <span class="regTsText"></span>
        <a href="javascript:" class="regSubmit JS_submit"><span>设置</span></a><!-- 点击提交 给按钮加个class regSubmit -->
    </div>
    <div class="wh reg_successBt">
        <div class="regTtBox regTtBox1">
            <span>
                <font>注册账号</font>
                <font>设置昵称</font>
                <font>进入页面</font>
            </span>
        </div>
    </div>
</form>
<script type="text/javascript">
    var redirect_url = '{$redirect_url}' || '/';
    $('.JS_submit').click(function(){
        $.ajax({
            url:$('form').attr('action'),
            data:$(".JS_input").serialize(),
            type:'post',
            dataType:'json',
            success:function(data){
                if(data.state < 0){
                    alert(data.info)
                    return;
                }else{
                    window.location.href= redirect_url;
                }
            }
        });
    });
</script>
</block>